package com.starsoft.frame.base.service;

import org.hibernate.Cache;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.starsoft.frame.core.orm.HibernateDao;
import com.starsoft.frame.core.service.BaseService;

@Service
public class HibernateService extends BaseService{

	@Autowired
	HibernateDao hibernateDao;
	
	public void hibernateBuffer(){
		SessionFactory sessionFactory = hibernateDao.getSessionFactory();
		Cache cache = sessionFactory.getCache();
		cache.evictEntityRegions();
		cache.evictCollectionRegions();
		cache.evictQueryRegions();
		cache.evictNaturalIdRegions();
	}
	
	public void reloadConfig(){
		
	}
}
